In recent years, a substantial amount of effort has been expended to improve the efficiency of digital data processing systems, both from the standpoint of the time required for executing a processing task and from the standpoint of reducing the amount of memory required during execution of any particular task. One concept that has been developed relative to improving execution time involves the use of multiple "threads of execution," with each thread of execution (or "thread") being a separate sequential flow of control that takes place during execution of the data processing program or application. Stated otherwise, a thread is the active execution of a designated data processing routine, including any nested routine invocations.
Digital data processing with multiple threads ("multi-threading") can provide increased processing efficiency both in data processing systems equipped with a single processing unit and in multiple processor systems which support parallel processing (concurrent processing by a plurality of processing units that are included in a single processing system or computer). For example, systems which provide hardware and software support for parallel processing of multiple threads (sometimes referred to as "kernel threads" or "light weight processes") can be employed to enable concurrent processing of a procedure by all of the processors, thereby dividing the task to be performed and decreasing the task execution time. In systems utilizing a single processor, one example of the use of multi-threading is employing one thread to monitor the user interface while one or more additional threads carry out computational and other data processing tasks. This use of multi-threading allows rapid system response to a user request even during periods of time in which a previous user request is being carried out by other threads. A second example of multi-threading in a single processor system is the use of one thread to implement input/output functions and other threads to implement other computational and data processing activities. In this case, multi-threading allows the processing system to overlap time-consuming input/output activities with computational and other data processing activities.
In many implementations of multi-threading, more than one thread executes the same data processing procedure and, in addition, each execution of the procedure that is common to the threads requires one or more sets of initialization data that is supplied either by the system user or is supplied as the result of another procedure that is executed during the course of the data processing operation. Moreover, in the same and other implementations of multi-threading, one or more of the threads may execute a number of procedures that require the same initial data.
Difficulties can arise if the data processing implementation stores a single copy of the required initialization data for shared use by threads that execute a common procedure or if one or more threads share a single copy of data for execution of a number of procedures that require the same initialization data. Specifically, if a common procedure that is executed by a number of threads modifies the initialization data during execution of the procedure, only the first thread will execute the common procedure with access to the correct data. Similarly, in implementations in which one or more of the threads executes a number of procedures that require the same initialization data and the data is modified during execution of the procedure, only the first executed procedure will have access to the correct data. Thus, in both single processor and multi-processor multi-threading data processing arrangements, sharing a single copy of initialization data can result in failure of the system to obtain the proper result.
There can be disadvantages and drawbacks of sharing initialization data between procedures of a single processor implementation of multi-threading even if only one of the procedures modifies or changes the initialization data. For example, although it is possible to schedule execution of the procedures so that the procedure that modifies the initialization data is performed only after execution of the other procedures that require that same data, such scheduling may result in far less than optimal operation since a substantial delay may be encountered while the system completes execution of all other procedures that require that data. Moreover, such a scheduling constraint may unduly increase the complexity of programming the system and may result in an undesirable amount of additional coded instructions that must be stored in system memory and executed.
There are two prior art approaches for providing identical initialization data to each procedure requiring that data. First, multiple copies of the data can be stored at known or predetermined addresses in the system memory with each copy in effect being assigned to a different thread. Multiple storage of this sort allows the procedures that are executed by a thread to access a different (or "thread private") copy of the initialization data. Second, a single copy of the data can be stored in memory and dynamically copied during execution of each procedure requiring that data. However, prior attempts to use these techniques have not resulted in a system which realizes to the full extent the decreased processing time and low memory overhead that can be attained in a multi-threading environment. For example, an extremely large amount of memory space can be required for separate stored copies of the initialization data in situations in which the procedures to be executed require numerous sets of initialization data.
Moreover, the prior art has not provided a system that satisfactorily, incorporates or facilitates certain other aspects or features of the current state of the data processing art. For example, in many data processing implementations, it is either desired or necessary that a process being executed be capable of incorporating one or more data processing routines that are stored in a separate library of the data processing memory. In such a case, the desired separate library procedures may be brought into system memory and linked with the user supplied routines before the procedures and data required for the data process are loaded into memory and executed. Alternatively, in some cases, one or more separate library procedures may be dynamically activated so that instructions and data for the separate library routine are not loaded into the memory space being used for the execution of other related data processing procedures until a procedure being executed references or calls the separate library routine.
Multi-threading data processing arrangements which store copies of the required initialization data at known memory addresses and allocate or assign a different copy of the initialization data to each thread of execution cannot be used in many situations that utilize procedures and data from a separate library. For example, oftentimes one or more of the procedures being executed in a multi-threading environment require initialization data that must be contributed by the separate library. If the procedure and data of the shared library are dynamically activated it is impossible to know the memory address for the initialization data when it is loaded into the memory space being used for processing.
Further, all or most of the prior art attempts to provide copies of data that are private to each thread of execution in a process have been implemented in accordance with a particular high level computer language such as FORTRAN 77. Because of the time and expense involved in developing a computer program in any particular programming language and in translating such a program into a different programming language, there is a growing need for data processing systems that create an executable program from program parts that are written in different languages. Attendant to that need is a need for improved multi-threading systems that are implemented in a generalized form that allows the multi-threading system to be incorporated in a data processing environment that is capable of creating an executable program from program parts that are written in different programming languages.